package com.shux.utils.other;

import java.util.List;

import com.shux.utils.page.PageData;

/**
 * 坐标管理工具类
 * @author 80002303
 *
 */
public class ConditionsUtil {
	
	/**
	 * 通过坐标搜索附近满足条件的店铺
	 */
	public static String findStore(List<PageData> stores,String coordinates){
		//存储满足条件的店铺
		String store_ids = "";
		for (int i = 0; i < stores.size(); i++) {
			String store_coordinates = stores.get(i).getString("STORE_COORDINATES");
			//获取店铺坐标和用户坐标距离
			double distance = BaiduMapUtil.getDistance(store_coordinates, coordinates);
			//设定限制坐标
			double limit_distance = 2000;
			if(distance<=limit_distance){
				store_ids += stores.get(i).getString("STORE_ID")+",";
			}
		}
		return store_ids;
	}
	

}
